home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
tpref.exe
/
TPR6.TXT
< prev
next >
Wrap
Text File
|
1992-10-19
|
59KB
|
1,595 lines
Chapter 6
of the
Turbo Pascal Reference
The Turbo Vision Reference
This chapter is part of the Turbo Pascal Reference electronic freeware book (C)
Copyright 1992 by Ed Mitchell. This freeware book contains supplementary
material to Borland Pascal Developer's Guide, published by Que Corporation,
1992. However, Que Corporation has no affiliation with nor responsibility for
the content of this free book. Please see Chapter 1 of the Turbo Pascal
Reference for important information about your right to distribute and use this
material freely. If you find this material of use, I would appreciate your
purchase of one my books, such as the Borland Pascal Developer's Guide or
Secrets of the Borland C++ Masters, Sams Books, 1992. Thank you.
For additional information on using Turbo Vision, including a detailed
tutorial, please see Chapters 11 through 16 of the Borland Pascal Developer's
Guide.
About the Turbo Vision Reference
The Turbo Vision Reference contains an alphabetized list of all Turbo
Vision objects, global variables, procedures, functions, types and constant.
This reference is substantially different than Borland's reference because:
1. Where possible, example code that actually uses the object type is
shown. Borland's documentation generally does not show sample code within
their Reference on Turbo Vision.
2. The reference includes all Turbo Vision features, including object
types, types, constants, variables, procedures and function. All are
grouped together in one alphabetized section, unlike Borland's reference,
where you must look in several sections to find the desired item.
3. Most importantly, I have highlighted the methods that you are most
likely to use within each object type. A problem with reading Borland's
documentation is that they present each object type followed by all twenty
to fifty possible methods within the object type. In real applications,
though, you may only need to concern yourself with perhaps five to ten
methods. Some of the variables and procedures are only useful to the
underlying implementation of Turbo Vision and may not be particularly
useful to your applications. Nonetheless, these internal procedures,
where available, are included in the Reference and are designated as
"internal" procedures.
When reading the Reference entires, keep in mind that since Turbo Vision
objects are themselves usually derived from other Turbo Vision objects, it can
be difficult to locate the definition of a particular method. For example, you
may see a procedure call such as,
Shell.ReDraw;
where Shell is derived from TApplication. You will need to look at the
description of TProgram from which TApplication is derived, and then back to
TView where you will finally locate the Redraw method. object which defines
them.
Naming Conventions
Turbo Vision uses standardized naming conventions as an aid to making
source code readable. The most important conventions are:
1. Type declarations begin with a capital letter T.
2. Pointers to object types begin with a capital letter P.
3. Registration records for stream I/O begin with a capital
letter R.
4. Except for color palette constants, identifiers beginning
with lower case letters are standard Turbo Vision constants.
The following table shows the standard constant prefix
characters:
Prefix Definition Example
ap Application palette apcolor
bf Button flag bfdefault
C Color palettes CListViewer
cm Command constant cmok
co Collection codes cooverflow
dm Drag mode dmdraggrow
ev Event constant evcommand
gf Grow mode flag gfgrowall
hc Help context hcnocontext
kb Keyboard code constant kbalta
mb Mouse button constant mbrightbutton
of Option flag oftopselect
P Pointer equivalent PCollection
R Registration record RCollection
sb Scroll bar sbrightarrow
sf State flag sfactive
sm Screen mode constant smfont8x8
st Stream code stok
T Object type TCollection
wf Window flags wfmove
wp Window color palettes wpbluewindow
The Turbo Vision Object Hierarchy
--------------------------------
All Turbo Vision objects are descended from the TObject type. All
displayable objects are descendants of TView (which is itself descended from
TObject). Displayable objects include items such as dialogs, check boxes,
buttons, windows and list boxes. Non-displayable objects are the TCollection,
TStream, TResourceFile, TStringList and TStrListMaker data structure objects.
The line of descent shown in the illustration, below, identifies how
functionality is inherited between the objeccts. For example, TDialog is
descended from TWindow and inherits functionality from the TWindow object.
Illustration showing inheritance relationships between the Turbo Vision object
types.
TObject
TView
TBackground
TButton
TCluster
TCheckBoxes
TRadioButtons
TFrame
TGroup
TProgram
TApplication
TDeskTop
TWindow
TDialog
THistoryWindow
THistory
TInputLine
TListViewer
TListBox
THistoryViewer
TMenuView
TMenuBar
TMenuBox
TScroller
TTextDevice
TTerminal
TScrollBar
TStaticText
TLabel
TParamText
TStatusLine
TCollection
TSortedCollection
TStringCollection
TResourceCollection
TStream
TDosStream
TBufStream
TEmsStream
TResourceFile
TStringList
TStrListMaker
Turbo Vision Object Descriptions
The following reference section contains each procedure, function,
variable, type and constant declaration defined in Turbo Vision, plus each of
the primary Turbo Vision objects. For the object descriptions, the information
as organized into sections:
Turbo Vision Hierarchy
This section displays the derivation order of each object to help you
understand how functionally has been inherited from parent to descendant.
For example, the TMenuBar object's derivation is indicated by this
drawing:
TObject
TView
TMenuView
TMenuBar
This shows that TMenuBar is a descendant of TMenuView, which is a
descendant of TView, which is a descendant of TObject.
Discussion
A brief overview of the purpose of each object is given in this section.
Commonly Used Features
This section summarizes the primary methods that your applications will
likely use so that you will not need to spend much time attempting to
understand the other facilities of the object. Many Turbo Vision objects
have a large variety of fields and methods available for use. However,
many of these are needed only for the implementation of Turbo Vision
itself, and in most practical applications you will only need to reference
a small selection of the fields and methods.
Example
Where appropriate, a typical example usage of the object is given here.
Fields
Each field is described. After the field's definition, a comment
indicating { Read only } or { Read/Write } indicates whether or not its
okay to directly access this field.
Methods
Every method defined for the object is presented in this section.